<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

		
		<title>Example of the output tag.</title>
		
		<!-- This CSS file is not necessary to use html5Widgets -->
		<link type="text/css" rel="stylesheet" href="../../shared/css/useragentmanExample.css">
		<link type="text/css" rel="stylesheet" href="css/form.css" />
		
		
		
		<!-- What powers html5Widgets -->
		<script type="text/javascript" src="../../shared/js/modernizr.com/modernizr-1.5.min.js">
		</script>
		<script type="text/javascript" src="../../shared/js/html5.js">
		</script>
		<script type="text/javascript" src="../../shared/js/Timer.js">
		</script>
		<script type="text/javascript" src="../../shared/js/EventHelpers.js">
		</script>
		
		<script type="text/javascript" src="../../shared/js/html5Widgets.js">
		</script>
		
	</head>
	<body id="myExample" class="html5Widgets-debug">
    	<div id="exampleBlurb">
    		<p>The following is an example of using the HTML5 <code>output</code> tag with a form's <code>oninput</code> event to do
			some calculations on the data within the form.  It uses html5Widgets to fix IE9's slightly misbehaved implementation of <code>oninput</code>. <a href="http://www.useragentman.com/blog/?p=3174">Back to the User Agent Man <code>oninput</code> article</a>.</p>
    	</div>
		
        <form method="get" action="result.html" 
			oninput="document.getElementById('taxes').innerHTML = Math.round(price.value * 0.15 * 100) / 100;
					 document.getElementById('total').innerHTML = Math.round(price.value * 1.15 * 100) / 100">
        	
			<fieldset>
				<legend>Money You Owe</legend>
			
				<p>Enter in the price and we will calculate what you owe us.</p>
	            <table class="formTable">
	                <tbody>
	                	<tr>
	                		<th>Price:</th>
							<td><input type="number" name="price" value="" autofocus="autofocus" />
							<div class="description">The total of the stuff you just bought.  When you fill
							this in, you will see the items below will change.</div>
							</td>
						</tr>
						
						<tr>
							<th>Taxes:</th>
							<td><output id="taxes">0</output>
							<div class="description">This is how much you have to give to The Man, whether you like it or not.</div>
							</td>
						</tr>
						
						<tr>
							<th>Total:</th>
							<td><output id="total">0</output>
							<div class="description">This is how much you have to shell out in total.  Have a nice day!</div>
							
							</td>
						</tr>
					</tbody>
				</table>
			</fieldset>
	</body>
</html>
